<c:if test="${not empty errors}">
	<c:forEach items="${errors}" var="error">
		${error.category} - ${error.message}<br />
	</c:forEach>
</c:if>

<form action="<%= path %>" method="post">
  
	<c:if test="${not empty <%= model_parameter_name %>.id}">
		<input type="hidden" name="<%= model_parameter_name %>.id" value="${<%= model_parameter_name%>.id}"/>
		<input type="hidden" name="_method" value="put"/>
	</c:if>

<% @attributes.each do |att| -%>
	<div class="field">
		<%= att.html_label %>:<br />
		<%- if att.type.eql?("references") -%>
		<select name="<%= model_parameter_name %>.<%=att.name%>.id">
		  <c:forEach var="<%=att.name%>" items="${<%=att.name%>List}">
		    <option value="${<%=att.name%>.id}" <c:if test = "${<%= model_parameter_name %>.<%=att.name%>.id == <%=att.name%>.id}">selected="true"</c:if>>
		      ${<%=att.name%>.id}
			</option>
		  </c:forEach>
		</select>
		<%- else -%>	
		<input type="text" name="<%= model_parameter_name %>.<%=att.name%>" value="${<%=model_parameter_name%>.<%=att.name%>}"/>
		<%- end -%>
	</div>
	
<% end -%>
  <div class="actions">
	  <button type="submit">send</button>
	</div>
</form>

<a href="<%= path %>">Back</a>
